require 'rubygems'
require 'savon'


class PaymentBilletInfo
  def initialize
    @client_billet = Savon::Client.new do
      wsdl.document = "http://www.mc747.homologa.isat.com.br/BancoService.svc?wsdl"
    end
  end
  
  def validate_purchase_billet(agency, account, value)
    r = @client_billet.request :tem, "PagarViaBoletoBancario" do
      soap.body = {
        "tem:agencia" => agency,
        "tem:conta" => account,
        "tem:valor" => value
      }
    end
    h = r.to_hash
    h[:pagar_via_boleto_bancario_response][:return]
  end
end
